package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementBusiMtnCrossMapper;
import com.ruoyi.net.domain.ElementBusiMtnCross;
import com.ruoyi.net.service.IElementBusiMtnCrossService;

/**
 * 网元-业务-mtn-cmtn-crossService业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementBusiMtnCrossServiceImpl implements IElementBusiMtnCrossService 
{
    @Autowired
    private ElementBusiMtnCrossMapper elementBusiMtnCrossMapper;

    /**
     * 查询网元-业务-mtn-cmtn-cross
     * 
     * @param id 网元-业务-mtn-cmtn-cross主键
     * @return 网元-业务-mtn-cmtn-cross
     */
    @Override
    public ElementBusiMtnCross selectElementBusiMtnCrossById(String id)
    {
        return elementBusiMtnCrossMapper.selectElementBusiMtnCrossById(id);
    }

    /**
     * 查询网元-业务-mtn-cmtn-cross列表
     * 
     * @param elementBusiMtnCross 网元-业务-mtn-cmtn-cross
     * @return 网元-业务-mtn-cmtn-cross
     */
    @Override
    public List<ElementBusiMtnCross> selectElementBusiMtnCrossList(ElementBusiMtnCross elementBusiMtnCross)
    {
        return elementBusiMtnCrossMapper.selectElementBusiMtnCrossList(elementBusiMtnCross);
    }

    /**
     * 新增网元-业务-mtn-cmtn-cross
     * 
     * @param elementBusiMtnCross 网元-业务-mtn-cmtn-cross
     * @return 结果
     */
    @Override
    public int insertElementBusiMtnCross(ElementBusiMtnCross elementBusiMtnCross)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiMtnCross.getId())) {
            elementBusiMtnCross.setId(uuid);
        }
        elementBusiMtnCross.setCreateBy(SecurityUtils.getUsername());
        elementBusiMtnCross.setCreateTime(DateUtils.getNowDate());
        elementBusiMtnCross.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMtnCross.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMtnCrossMapper.insertElementBusiMtnCross(elementBusiMtnCross);
    }

    /**
     * 修改网元-业务-mtn-cmtn-cross
     * 
     * @param elementBusiMtnCross 网元-业务-mtn-cmtn-cross
     * @return 结果
     */
    @Override
    public int updateElementBusiMtnCross(ElementBusiMtnCross elementBusiMtnCross)
    {
        elementBusiMtnCross.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMtnCross.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMtnCrossMapper.updateElementBusiMtnCross(elementBusiMtnCross);
    }

    /**
     * 批量删除网元-业务-mtn-cmtn-cross
     * 
     * @param ids 需要删除的网元-业务-mtn-cmtn-cross主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMtnCrossByIds(String[] ids)
    {
        return elementBusiMtnCrossMapper.deleteElementBusiMtnCrossByIds(ids);
    }

    /**
     * 删除网元-业务-mtn-cmtn-cross信息
     * 
     * @param id 网元-业务-mtn-cmtn-cross主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMtnCrossById(String id)
    {
        return elementBusiMtnCrossMapper.deleteElementBusiMtnCrossById(id);
    }
}
